{% extends "admin/base_site.html" %}
{% load i18n admin_static bootstrapped_goodies_tags %}

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}dashboard{% endblock %}

{% block breadcrumbs %}
<ul class="breadcrumb">
<li>{% trans 'Home' %}</li>
</ul>
{% endblock %}

{% block object-tools %}
<ul class="nav navbar-nav">
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Applications" %} <span class="caret"></span></a>
        <ul class="dropdown-menu" role="menu">
            {% for app in app_list %}
            <li class="dropdown-submenu">
                <a href="#">{% render_with_template_if_exist app.name|lower|add:"/admin_app_name.html" app.name %}</a>
                <ul class="dropdown-menu">
                {% for model in app.models %}
                    <li>
                        {% if model.admin_url %}
                            <a href="{{ model.admin_url }}">{{ model.name }}</a>
                        {% else %}
                            {{ model.name }}
                        {% endif %}
                    </li>
                {% endfor %}
                </ul>
            </li>
            {% endfor %}
        </ul>
    </li>
</ul>
{% endblock %}


{% block content %}
<div class="row">
    <div id="content-main" class="col-sm-12">

        <div class="tabbable">
            {% for app in app_list %}
                {% include "admin/bootstrapped_extra/app_name.html" %}
                {% render_with_template_if_exist app.name|lower|add:"/admin_app_description.html" "" %}
                <table summary="{% blocktrans with name=app.name %}Models available in the {{ name }} application.{% endblocktrans %}" class="table table-striped table-bordered">
                {% for model in app.models %}
                    <tr>
                        <th scope="row">
                            {% if model.admin_url %}
                            <a href="{{ model.admin_url }}">{{ model.name }}</a>
                            {% else %}
                            {{ model.name }}
                            {% endif %}

                            {% if model.add_url or model.admin_url%}
                            <div class="pull-right">
                                {% if model.add_url %}
                                <a href="{{ model.add_url }}" class="btn btn-xs addlink"><span class="glyphicon glyphicon-plus"></span>
                                {% trans 'Add' %}</a>
                                {% endif %}
                                {% if model.admin_url %}
                                <a href="{{ model.admin_url }}" class="btn btn-xs changelink"><span class="glyphicon glyphicon-edit"></span>
                                {% trans 'Change' %}</a>
                                {% endif %}
                            </div>
                            {% endif %}
                        </th>
                    </tr>
                {% endfor %}
                </table>
            {% empty %}
                <p>{% trans "You don't have permission to edit anything." %}</p>
            {% endfor %}
        </div>
    </div>
</div>
{% endblock %}

{% block sidebar %}
{% endblock %}
